home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / tttool30.arc / WINDOW.TTT < prev    next >
Text File  |  1986-09-28  |  4KB  |  95 lines

  1. {+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
  2. {                                                                           }
  3. {           T E C H N O J O C K S     T U R B O    T O O L K I T            }
  4. {                                                                           }
  5. {                      Module   :   Window.TTT                              }
  6. {                                                                           }
  7. {                      Version  :   3.0 , October 1, 1986                   }
  8. {                                                                           }
  9. {                      Purpose  :   Screen save & window utilities          }
  10. {                                                                           }
  11. {                 Requirements  :   Decl.TTT                                }
  12. {                                   Fastwrit.TTT                            }
  13. {                                                                           }
  14. {                                                                           }
  15. {  Proc   Savescreen(Page:byte);                                            }
  16. {         RestoreScreen(Page:byte);                                         }
  17. {         DisposeScreen(Page:byte);                                         }
  18. {         MakeWin(X1,Y1,X2,Y2,fore,back,boxtype:integer);                   }
  19. {         RmWin;                                                            }
  20. {                                                                           }
  21. {                                                Bob Ainsbury               }
  22. {                                                Technojock                 }
  23. {                                                Houston                    }
  24. {                                                (713) 293-2760             }
  25. {+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
  26.  
  27. {
  28. ****************************
  29. * Screen Saving Procedures *
  30. ****************************
  31. }
  32.  
  33. Procedure SaveScreen(Page:byte);
  34. var dummy1,dummy2 : integer;
  35. begin
  36. If ((WindowCounter = 0) and (Page > Max_Screens))
  37. or ((WindowCounter > 0) and (Page > Max_WindowsandScreens)) then
  38. begin
  39.  Writeln(^G,'Too many screens saved, check Max_pages/Max_windows Const in DECL.TTT');
  40.  Halt;
  41. end;
  42. New(Screen[Page]);
  43. If Snow then VideoOff;
  44. If Crtmode = 7 then
  45.  Move(Monobuffer,Screen[Page]^.ScreenSnap, 4096)
  46. else
  47.  Move(Colorbuffer,Screen[Page]^.Screensnap, 4096);
  48. If snow then VideoOn;
  49. FindCursor(Screen[Page]^.CursorX,Screen[Page]^.CursorY,Dummy1,Dummy2);
  50. end;
  51.  
  52. Procedure RestoreScreen(Page:byte);
  53. begin
  54. If Snow then VideoOff;
  55. If Crtmode = 7 then
  56.  Move(Screen[Page]^, Monobuffer, 4096)
  57. else
  58.  Move(Screen[Page]^, Colorbuffer, 4096);
  59. If Snow then VideoOn;
  60. PosCursor(Screen[Page]^.CursorX,Screen[Page]^.CursorY);
  61. end;
  62.  
  63. Procedure DisposeScreen(Page:byte);
  64. begin
  65. Dispose(Screen[Page]);
  66. end;
  67. {
  68. ****************************
  69. *   Windowing Procedures   *
  70. ****************************
  71. }
  72.  
  73. procedure mkwin(x1,y1,x2,y2,F,B,boxtype:integer);
  74. begin
  75.   WindowCounter :=  WindowCounter + 1;
  76.   If WindowCounter > Max_WindowsandScreens - Max_Screens then
  77.   begin
  78.    writeln(^G,' Too many Windows change Max_Windows Const in DECL.TTT');
  79.    halt;
  80.   end;
  81.   SaveScreen(Max_Screens + WindowCounter);
  82.   Box(x1,y1,x2,y2,F,B,boxtype);
  83.   ClearText(x1+1,y1+1,x2-1,y2-1,F,B);
  84. end;
  85.  
  86. procedure rmwin;
  87. begin
  88. If WindowCounter > 0 then
  89. begin
  90.  RestoreScreen(Max_Screens + WindowCounter);
  91.  DisposeScreen(Max_Screens + WindowCounter);
  92.  WindowCounter := WindowCounter - 1;
  93. end;
  94. end;
  95.